import java.util.Arrays;

/**
 * @author wang'ji'cheng
 * @date 2025/7/19
 */
public class StringBuilderDemo2 {
    public static void main(String[] args) {

        int[] arr = {1,2,3};
        System.out.println("拼接前================");
        System.out.println(Arrays.toString(arr));
        StringBuilder sb = new StringBuilder();
        sb.append("[");
        for (int i = 0 ;i<arr.length ;i++) {
           if (i==arr.length-1){
               sb.append(arr[i]);
           }else{
               sb.append(arr[i]).append(",");
           }
        }
        sb.append("]");
        System.out.println("拼接后================");
        System.out.println(sb);
    }
}
